package com.site.test;

import com.google.zxing.*;
import com.google.zxing.client.j2se.BufferedImageLuminanceSource;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.common.HybridBinarizer;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import com.site.utils.BarCodeUtils;
import org.junit.Test;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileOutputStream;
import java.nio.file.Path;
import java.util.HashMap;
import java.util.Map;

public class generateCode {
    BarCodeUtils barCodeUtils = new BarCodeUtils();
    @Test
    public void test1(){
        /*生成条形码*/
        barCodeUtils.generateCode1(new File("F:\\code\\hurricane_house1.0\\img\\2dcode.png"), "adsfasdfasdfsad423524352345234523452345", 500, 250);
    }
    @Test
    public void test2(){
        /*读取条形码*/
        barCodeUtils.readCode(new File("F:\\code\\hurricane_house1.0\\img\\2dcode.png"));
    }
    @Test
    public void test3() {
        /*生成二维码*/
        barCodeUtils.generateQRCode(new File("F:\\code\\hurricane_house1.0\\img\\smt.png"), "淑玫唐家居网");
    }
    @Test
    public void test4() {
        /*读取二维码*/
        barCodeUtils.readQRCode(new File("F:\\code\\hurricane_house1.0\\img\\smt.png"));
    }







}
